/***************************************************************
 *
 * Filename：MessagePRO.cpp
 * Abstract：the design of IP Proco
 * version ：1.0
 *
 * Copyright (c) 2011 SCUT DT&P FY&XC
 *
***************************************************************/

#include "ipmsg.h"

MessagePRO::MessagePRO(){
	username = QHostInfo::localHostName();
	hostname = QHostInfo::localHostName()+"*";  
        qDebug()<<QHostInfo::localDomainName()<<"in MessagePRO::MessagePRO";
	version = PIGEONS_VERSION;
	packetno = QDateTime::currentDateTime().toTime_t();//实际返回uint，有点不匹配

}
unsigned long MessagePRO::getPacketno()
{
	return packetno;
}
QString MessagePRO::getUsername()
{
	return username;
}
QString MessagePRO::getHostname()
{
	return hostname;
}
QHostAddress MessagePRO::getAddress()
{
	return address;
}
int MessagePRO::getVersion()
{
	return version;
}
unsigned long MessagePRO::getCommand()
{
	return command;
}
QString MessagePRO::getExtend()
{
	return extend;
}
MessagePRO* MessagePRO::makeMng(QString username, QString hostname, unsigned long command, QString extend,QHostAddress addr)
{
	MessagePRO *msg = new MessagePRO;
	msg->username = username;
	msg->hostname = hostname;
	msg->command = command;
	msg->extend = extend;
	msg->address = addr;
	return msg;
}

void MessagePRO::parseMsg()
{
}
